import { ElMessageBox } from 'element-plus/es';

function confirm(message, title = '操作确认', option = {}) {
  return ElMessageBox.confirm(message, title, {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
    ...option
  });
}

function confirmDelete(message, title = '操作确认', option = {}) {
  return ElMessageBox.confirm(message, title, {
    confirmButtonText: '确定',
    cancelButtonText: '取消',
    type: 'warning',
    ...option
  });
}

export const useMessageBox = () => {
  return {
    confirm,
    confirmDelete
  };
};
